/**
 * 
 */
package j2ee_pattern.transfer_object_pattern;

/**
 * 传输对象模式
 * 通过各种方式获得多个属性的对象
 * @author Administrator
 *
 */
public class TransferObjectPatternDemo {
	public static void main(String[] args) {
		
		 StudentBO studentBusinessObject = new StudentBO();
		 //输出所有的学生
	      for (StudentVO student : studentBusinessObject.getAllStudents()) {
	         System.out.println("Student: [RollNo : "
	         +student.getRollNo()+", Name : "+student.getName()+" ]");
	      }
	      //更新学生
	      StudentVO student =studentBusinessObject.getAllStudents().get(0);
	      student.setName("Michael");
	      studentBusinessObject.updateStudent(student);
	      
	      //获取学生
	      student = studentBusinessObject.getStudent(0);
	      System.out.println("Student: [RollNo : "
	      +student.getRollNo()+", Name : "+student.getName()+" ]");
	}
}
